const { google } = require("googleapis");
const fs = require("fs");
const path = require("path");
const config = require("../config");
const scopes = ["https://www.googleapis.com/auth/androidpublisher"];

async function androidPublisherConn() {
    try {
         
     

     


        const auth = new google.auth.GoogleAuth({
            keyFile: '/zj-manager/zj-background-manager/remote-android_key.json',
            scopes: scopes,
        });

        const authClient = await auth.getClient();

        const androidpublisher = google.androidpublisher({
            version: "v3",
            auth: authClient,
        });

        return androidpublisher;
    } catch (error) {
        console.error(error);
        return null;
    }
}
module.exports = androidPublisherConn;
